package com.monai.aidati.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitConfig {
    @Bean
    public Queue WorkQueue(){
        return QueueBuilder.durable("bi_queue").build();
    }
    @Bean
    public DirectExchange WorkExchange(){
        return ExchangeBuilder.directExchange("bi_exchange").durable(true).build();
    }
    @Bean
    public Binding driectbingQueue(DirectExchange WorkExchange, Queue WorkQueue ){
        return BindingBuilder.bind(WorkQueue).to(WorkExchange).with("bi_routingKey");
    }
}
